home *** CD-ROM | disk | FTP | other *** search
/ Visual Cafe 3 / Visual Cafe 3.ISO / Vcafe / Main.bin / TitledBorderBeanInfo.java < prev    next >
Text File  |  1998-10-21  |  3KB  |  77 lines

  1. package com.symantec.itools.swing.borders;
  2.  
  3. import java.beans.*;
  4. import com.symantec.itools.vcafe.beans.PropertyDescriptorAttributes;
  5. import com.symantec.itools.vcafe.beans.PropertyHelpIDs;
  6.  
  7. public final class TitledBorderBeanInfo
  8.     extends BorderBeanInfo
  9. {
  10.     public TitledBorderBeanInfo()
  11.     {
  12.         super();
  13.         
  14.         set16x16ColorIconName("TitledBorder.gif");
  15.     }
  16.     
  17.     protected Class getBeanClass()
  18.     {
  19.         return TitledBorder.class;
  20.     }
  21.     
  22.     public PropertyDescriptor[] getPropertyDescriptors()
  23.     {
  24.         try
  25.         {
  26.             Class beanClass = getBeanClass();
  27.             
  28.             PropertyDescriptor title = new PropertyDescriptor("title", beanClass);
  29.             title.setValue(PropertyDescriptorAttributes.WIN_HELP_ATTRIBUTE, new Integer(PropertyHelpIDs.TITLEDBORDER_TITLE_HELP_ID));
  30.     
  31.             PropertyDescriptor titlePositionPD = new PropertyDescriptor("titlePosition", beanClass);
  32.             titlePositionPD.setPropertyEditorClass(TitlePositionPropertyEditor.class);
  33.             titlePositionPD.setValue(PropertyDescriptorAttributes.WIN_HELP_ATTRIBUTE, new Integer(PropertyHelpIDs.TITLEDBORDER_TITLE_POSITION_HELP_ID));
  34.             
  35.             PropertyDescriptor titleJustificationPD = new PropertyDescriptor("titleJustification", beanClass);
  36.             titleJustificationPD.setPropertyEditorClass(TitleJustificationPropertyEditor.class);
  37.             titleJustificationPD.setValue(PropertyDescriptorAttributes.WIN_HELP_ATTRIBUTE, new Integer(PropertyHelpIDs.TITLEDBORDER_TITLE_JUSTIFICATION_HELP_ID));
  38.             
  39.             PropertyDescriptor borderPD = new PropertyDescriptor("border", beanClass);
  40.             borderPD.setValue(com.symantec.itools.vcafe.beans.ObjectReferenceAttributes.OBJECTREFERENCE_DEFAULT_IS_NONE_ATTRIBUTE,Boolean.TRUE);
  41.             borderPD.setValue(PropertyDescriptorAttributes.WIN_HELP_ATTRIBUTE, new Integer(PropertyHelpIDs.TITLEDBORDER_BORDER_HELP_ID));
  42.             
  43.             PropertyDescriptor titleFont = new PropertyDescriptor("titleFont", beanClass);
  44.             titleFont.setValue(PropertyDescriptorAttributes.WIN_HELP_ATTRIBUTE, new Integer(PropertyHelpIDs.TITLEDBORDER_TITLE_FONT_HELP_ID));
  45.             
  46.             PropertyDescriptor titleColor = new PropertyDescriptor("titleColor", beanClass);
  47.             titleColor.setValue(PropertyDescriptorAttributes.WIN_HELP_ATTRIBUTE, new Integer(PropertyHelpIDs.TITLEDBORDER_TITLE_COLOR_HELP_ID));
  48.             
  49.             PropertyDescriptor[] rv = {
  50.                     title,
  51.                     borderPD,
  52.                     titlePositionPD,
  53.                     titleJustificationPD,
  54.                     titleFont,
  55.                     titleColor };
  56.             
  57.             return rv;
  58.         }
  59.         catch(IntrospectionException e)
  60.         {
  61.             e.printStackTrace();
  62.         }
  63.         
  64.         //Error, return no properties
  65.         return new PropertyDescriptor[0];
  66.     }
  67.  
  68.     protected void modifyBeanDescriptor(BeanDescriptor beanDescriptor)
  69.     {
  70.         super.modifyBeanDescriptor(beanDescriptor);
  71.         
  72.         beanDescriptor.setValue("WINHELP", winHelpID);
  73.     }
  74.     
  75.     protected final static String winHelpID = "0x60136";
  76. }
  77.